export default {
	namespaced: true,
	state: {
		isPayOrderList: JSON.parse(uni.getStorageSync('isPayOrderList') || '[]'),  // 已支付订单
		NoPayOrderList: JSON.parse(uni.getStorageSync('NoPayOrderList') || '[]'),	 		// 未支付订单
		cencleOrderList: JSON.parse(uni.getStorageSync('cencleOrderList') || '[]'),	 // 已取消订单
		completeOrderList: JSON.parse(uni.getStorageSync('completeOrderList') || '[]'),	 // 已完成订单
		refundOrderList: JSON.parse(uni.getStorageSync('refundOrderList') || '[]'),	 // 退款订单

		hxOrderList: JSON.parse(uni.getStorageSync('hxOrderList') || '[]'),	 // 核销订单
		// 小票订单
		printerOrderList: JSON.parse(uni.getStorageSync('printerOrderList') || '[]'),	 // 小票订单
	},
	mutations: {
		setPrinterOrderList(state, data) {
			try {
				uni.setStorageSync('printerOrderList', JSON.stringify(data))
				state.printerOrderList = data
			} catch (e) {
			}
		},
		clearPrinterOrderList(state) {
			uni.removeStorageSync('printerOrderList')
			state.printerOrderList = []
		},
		setHxOrderList(state, data) {
			try {
				uni.setStorageSync('hxOrderList', JSON.stringify(data))
				state.hxOrderList = data
			} catch (e) {
			}
		},
		clearHxOrderList(state) {
			uni.removeStorageSync('hxOrderList')
			state.hxOrderList = []
		},
		setIsPayOrderList(state, data) {
			try {
				uni.setStorageSync('isPayOrderList', JSON.stringify(data))
				state.isPayOrderList = data
			} catch (e) {
			}
		},
		setNoPayOrderList(state, data) {
			try {
				uni.setStorageSync('NoPayOrderList', JSON.stringify(data))
				state.NoPayOrderList = data
			} catch (e) {
				console.log('用户数据错误')
			}
		},
		setCencleOrderList(state, data) {
			try {
				uni.setStorageSync('cencleOrderList', JSON.stringify(data))
				state.cencleOrderList = data
			} catch (e) {
				console.log('用户数据错误')
			}
		},
		setCompleteOrderList(state, data) {
			try {
				uni.setStorageSync('completeOrderList', JSON.stringify(data))
				state.completeOrderList = data
			} catch (e) {
				console.log('用户数据错误')
			}
		},
		setRefundOrderList(state, data) {
			try {
				uni.setStorageSync('refundOrderList', JSON.stringify(data))
				state.refundOrderList = data
			} catch (e) {
				console.log('用户数据错误')
			}
		},
		clearIsPayOrderList(state) {
			uni.removeStorageSync('isPayOrderList')
			state.isPayOrderList = []
		},
		clearNoPayOrderList(state) {
			uni.removeStorageSync('NoPayOrderList')
			state.NoPayOrderList = []
		},
		clearCencleOrderList(state) {
			uni.removeStorageSync('cencleOrderList')
			state.cencleOrderList = []
		},
		clearCompleteOrderList(state) {
			uni.removeStorageSync('completeOrderList')
			state.completeOrderList = []
		},
		clearRefundOrderList(state) {
			uni.removeStorageSync('refundOrderList')
			state.refundOrderList = []
		}
	},
	actions: {

	}
}